<?php
/********/
/* Photo gallery */
/********/

define("T_photogals_cat","pms_plug_photogals_category");
define("T_photogals","pms_plug_photogals_content");

/* selection ad(liste)*/
$sql['photogals']['get_all_cat']="SELECT * FROM ".T_photogals_cat." ORDER BY category_name ASC";
$sql['photogals']['get_cat_nb_total']="SELECT COUNT(*) AS nb FROM ".T_photogals_cat." ";
$sql['photogals']['get_filtered_cat']="SELECT * FROM ".T_photogals_cat." {condition} {order} {limit}";

/* get cat images liste */
$sql['photogals']['get_cat_images'] = "SELECT * FROM ".T_photogals." WHERE category_id = {id}";
/* insertion image dans une categorie*/
$sql['photogals']['insert_cat_image']="INSERT INTO ".T_photogals." 
                            (category_id, image_name, image_description) 
                            VALUES ('{imagecat}','{phototoadd}','{imagedescription}')";  
/* suppression d'une image' */
$sql['photogals']['delete_cat_image']="DELETE FROM ".T_photogals." WHERE image_id='{id}'";

/* selection (details) */
$sql['photogals']['get_cat_details'] = "SELECT * FROM ".T_photogals_cat." WHERE category_id ='{id}'";

/* insertion */
$sql['photogals']['insert_cat']="INSERT INTO ".T_photogals_cat." 
                            (category_name, category_description, category_home_img) 
                            VALUES ('{name}','{description}','{file}')";  

# modification
$sql['photogals']['edit_cat']="UPDATE ".T_photogals_cat." 
                        SET category_name='{name}',category_description='{description}' , category_home_img='{file}'
                        WHERE category_id='{id}' ";

/* suppression */
$sql['photogals']['delete_cat']="DELETE FROM ".T_photogals_cat." WHERE category_id='{id}'";
?>